<!--  -->
<template>
  <div class="goods">
    <!-- <goods-list-item v-for="item in goods" :key="item.index" /> -->
    <goods-list-item v-for="item in goods" :key="item.index" :goodsItem="item" />
  </div>
</template>

<script>
import GoodsListItem from './GoodsListItem'
export default {
  name: 'GoodsList',
  props: {
    goods: {
      type:Array,
      default() {
        return []
      }
    }
  },
  components: {
    GoodsListItem
  },
  data() {
    return {

    }
  },
  // 生命周期 - 创建完成（访问当前this实例）
  created() {
    // console.log('goods:')
    // console.log(this.goods)
  },
  // 生命周期 - 挂载完成（访问DOM元素）
  mounted() {

  }
}
</script>
<style scoped>
/* @import url(); 引入css类 */
  .goods{
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content:space-around;
  }
</style>
